package com.example.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("book")
public class Book {

    //图书编号
    @TableId(type = IdType.AUTO)
    private Integer id;
    //图书名称
    private String name;
    //图书简介
    private String msg;
    //图书类别
    private String category;
    //图书数量
    private Integer sum;
    //入库时间
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate entryTime;
    //更新时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
